<?php $this->pageTitle = 'Đăng nhập' . ' - ' . Option::getItem('site_name'); ?>
<div class="row-fluid">
    <div class="breadcrumbs hr-bottom">
        <?php echo $this->renderPartial('/layouts/breadcrumbs'); ?>
    </div>
    <?php if (Yii::app()->user->hasFlash('success')): ?>
        <div class="alert alert-success">
            <?php echo Yii::app()->user->getFlash('success'); ?>
        </div>
    <?php endif; ?>
    <?php if (Yii::app()->user->hasFlash('error')): ?>
        <div class="alert alert-error">
            <?php echo Yii::app()->user->getFlash('error'); ?>
        </div>
    <?php endif; ?>
    <br>
    <?php
    $form = $this->beginWidget('CActiveForm', array(
        'id'                     => 'login-form',
        'enableAjaxValidation'   => true,
        'enableClientValidation' => true,
        'action'                 => Yii::app()->createUrl('user/login'),
        'htmlOptions'            => array('class' => 'form-horizontal'),
    ));
    ?>
    <!--<font color="red"><?php // echo CHtml::errorSummary($model);   ?></font>-->
    <div class="control-group">
        <?php echo $form->labelEx($model, 'email', array('class' => 'control-label')); ?>
        <div class="controls">
            <?php
            echo $form->textField($model, 'email', array(
                'placeholder' => 'Tên đăng nhập',
                'class'       => 'input-xlarge'
            ));
            ?>
        </div>
        <font color="red"><?php echo $form->error($model, 'email', array('class' => 'err')); ?></font>
    </div>
    <div class="control-group">
        <?php echo $form->labelEx($model, 'password', array('class' => 'control-label')); ?>
        <div class="controls">
            <?php
            echo $form->passwordField($model, 'password', array(
                'placeholder' => 'Mật khẩu của bạn',
                'class'       => 'input-xlarge'
            ));
            ?>
        </div>
        <font color="red"><?php echo $form->error($model, 'password', array('class' => 'err')); ?></font>
    </div>
    <div class="control-group">
        <div class="controls">
            <span>Bạn chưa có tài khoản?</span>
            <a href="<?php echo Yii::app()->createUrl('user/register') ?>" class="text-info">Tạo tài khoản</a>
            <label class="checkbox">
                <?php echo $form->checkBox($model, 'rememberMe'); ?> <label for="remember">Ghi nhớ mật khẩu</label>
            </label>
        </div>
    </div>
    <div class="control-group">
        <div class="controls">
            <button type="submit" class="btn btn-info">Đăng nhập</button>
        </div>
    </div>
    <?php $this->endWidget(); ?>
</div>
<div class="register bg-pink">
    <?php echo $this->renderPartial('//layouts/_register') ?>
</div>
<script>
    $('#loading').remove();
</script>